import {onMounted, ref} from "vue";
const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从0开始，需要加1
const day = String(today.getDate()).padStart(2, '0');
const formattedDate = `${year}年${month}月${day}日`; // 输出格式为 YYYY年MM月DD日

const option = {
  title: {
    text: '使用者的性别占比',
    textStyle: {
      color: '#028370' // 字体颜色
    },
    subtext: formattedDate,
    top: 10,
    left: 10
},
  series: [
    {
      name: '使用者的性别占比',
      type: 'pie',
      radius: ['40%', '70%'],
      avoidLabelOverlap: false,
      itemStyle: {
        borderRadius: 10,
        borderColor: '#fff',
        borderWidth: 10
      },
      label: {
        show: false,
        position: 'center'
      },
      emphasis: {
        label: {
          show: true,
          fontSize: '26',
          fontWeight: 'bold',
          formatter: (p) => {
            let dom = `<div backgroundColor="red">1</div>`
            return p.name + '\n' + p.value
          }
        }
      },
      labelLine: {
        show: false
      },

      data: [
        { value: 3, name: '女' },
        { value: 5, name: '男' },
        // { value: 80, name: '网络营销' },
        // { value: 484, name: '联盟广告' },
        // { value: 300, name: '视频广告' }
      ]
    }
  ]
};

export default option